﻿/*****************************************************
 * 本类库的核心系 JNTemplate
 * (C) JNTemplate 2011
 * 作者：翅膀的初衷 QQ:4585839
 * 网址：http://www.JiNianNet.com
 *****************************************************/
using System;

namespace JinianNet.JNTemplate.Process.Element
{
    public class Token
    {
        private string _text;

        private TokenKind _tokenKind;

        private string _name;

        private bool _cache;

        public bool Cache
        {
            get { return this._cache; }
            set { this._cache = value; }
        }
        public string Name
        {
            get { return this._name; }
            set { this._name = value; }
        }

        public TokenKind TokenKind
        {
            get { return this._tokenKind; }
            set { this._tokenKind = value; }
        }

        public string Text
        {
            get { return this._text; }
            set { this._text = value; }
        }

        public Token(TokenKind kind, string text)
        {
            this._tokenKind = kind;
            this._text = text;
            this._cache = false;
        }

        public virtual object Parser(VariableScope varScope)
        {
            return this._text;
        }

        public virtual void Parser(VariableScope varScope, System.IO.TextWriter write) {
            write.Write(this._text);
        }

        public override string ToString()
        {
            return this._text;
        }


    }
}
